package com.ricchieri.common;

import java.util.Date;

import org.primefaces.model.DefaultScheduleEvent;

import com.ricchieri.model.ScheduleCharter;
import com.ricchieri.util.DateUtil;

public class CustomScheduleEvent extends DefaultScheduleEvent {

	private static final long serialVersionUID = 3845050597679035864L;
	
	private Date time;
	private String frecuency;
	private String selectedCharter;
	private String selectedUser;
	private ScheduleCharter scheduleCharter;
	
	
	public CustomScheduleEvent() {
		super();
	}
	
	public CustomScheduleEvent(ScheduleCharter scheduleChar) {
		super(" ", scheduleChar.getSchedule().getDate(), scheduleChar.getSchedule().getDate());
		this.time = scheduleChar.getSchedule().getTime();
		this.setStartDate(DateUtil.converToDate(this.getStartDate(), scheduleChar.getSchedule().getTime()));
		
		if(scheduleChar.getCharter() != null) {
			this.setSelectedCharter(String.valueOf(scheduleChar.getCharter().getId()));
		}
		
		if(scheduleChar.getUser() != null) {
			this.setSelectedUser(String.valueOf(scheduleChar.getUser().getId()));
		}
		
		this.scheduleCharter = scheduleChar; 
	}
	
	public CustomScheduleEvent(java.lang.String title, java.util.Date start, java.util.Date end, String selectedCharter, Date time, String selectedUser) {
		super(title, start, end);
		this.time = time;
		this.selectedCharter = selectedCharter;
		this.selectedUser = selectedUser;
	}
	
	
	public String getFrecuency() {
		return frecuency;
	}
	
	public void setFrecuency(String frecuency) {
		this.frecuency = frecuency;
	}
	
	public Date getTime() {
		return time;
	}
	
	public void setTime(Date time) {
		this.time = time;
	}
	
	public String getSelectedCharter() {
		return selectedCharter;
	}

	public void setSelectedCharter(String selectedCharted) {
		this.selectedCharter = selectedCharted;
	}

	public String getSelectedUser() {
		return selectedUser;
	}

	public void setSelectedUser(String selectedUser) {
		this.selectedUser = selectedUser;
	}

	public ScheduleCharter getScheduleCharter() {
		return scheduleCharter;
	}

	public void setScheduleCharter(ScheduleCharter scheduleCharter) {
		this.scheduleCharter = scheduleCharter;
	}
	
	
}
